/*
   @Copyright:LeetCode
   @Author:   tjyemail
   @Problem:  http://leetcode.com/problems/remove-element
   @Language: C++
   @Datetime: 19-05-30 17:26
   */

class Solution {
public:
	int removeElement(vector<int>& nums, int val) {
		int len=0;
		for(int i=0; i<nums.size(); ++i)
			if(nums[i]!=val) nums[len++]=nums[i];
		return len;
	}
};
